You specify a file filter function to determine which files appear in the displayed list of files and folders when the user is opening a file. You can define a standard or custom file filter.
A file filter function whose address is passed to StandardGetFile should have the following form:
FUNCTION MyStandardFileFilter (pb: CInfoPBPtr): Boolean;
When StandardGetFile is displaying the contents of a volume or folder, it checks the file type of each file and filters out files whose types do not match your application's specifications. If your application also supplies a file filter function, the Standard File Package calls that function each time it identifies a file of an acceptable type.
When your file filter function is called, it is passed, in the pb parameter, a pointer to a catalog information parameter block. See the chapter "File Manager" in this book for a description of the fields of this parameter block.
Your function evaluates the catalog information parameter block and returns a Boolean value that determines whether the file is filtered (that is, a value of TRUE suppresses display of the filename, and a value of FALSE allows the display). If you do not supply a file filter function, the Standard File Package displays all files of the specified types.
See "Writing a File Filter Function" for a sample file filter function.
A file filter function whose address is passed to CustomGetFile should have the following form:
FUNCTION MyCustomFileFilter (pb: CInfoPBPtr; myDataPtr: Ptr):
Boolean;
When CustomGetFile is displaying the contents of a volume or folder, it checks the file type of each file and filters out files whose types do not match your application's specifications. If your application also supplies a file filter function, the Standard File Package calls that function each time it identifies a file of an acceptable type.
When your file filter function is called, it is passed, in the pb parameter, a pointer to a catalog information parameter block. See the chapter "File Manager" in this book for a description of the fields of this parameter block.
Your function evaluates the catalog information parameter block and returns a Boolean value that determines whether the file is filtered (that is, a value of TRUE suppresses display of the filename, and a value of FALSE allows the display). If you do not supply a file filter function, the Standard File Package displays all files of the specified types.
See "Writing a File Filter Function" for a sample file filter function.